package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(20);not null;index:ip_idx commit:'用户名'"`
	Password string `gorm:"type:varchar(50);not null;index:ip_idx commit:'密码'"`
}

func (u *User) Find(Username string) error {
	return DB.Where("username=?", Username).Find(&u).Error
}
